Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update cloudconnexa_user resource #40

Merged
merged 7 commits into from
Aug 5, 2024

Conversation

sahaqaa
Copy link
Contributor

@sahaqaa sahaqaa commented Aug 2, 2024

Removed "ForceNew" from "role" field for "cloudconnexa_user" resource.
Also removed warning:

 Warning: The user's role cannot be changed using the code.
│ 
│   with cloudconnexa_user.this,
│   on main.tf line 1, in resource "cloudconnexa_user" "this":
│    1: resource "cloudconnexa_user" "this" {
│ 
│ There is a bug in CloudConnexa API that prevents setting the user's role during the creation. All users are created as Members by default. Once it's fixed, the provider will be updated
│ accordingly.
╵

I tried to create new user like this with ADMIN role and it worked:

resource "cloudconnexa_user_group" "this" {
  name           = "test-group"
  vpn_region_ids = ["eu-central-1"]
  connect_auth   = "AUTH"
}


resource "cloudconnexa_user" "name" {
  username   = "trolololo"
  group_id   = cloudconnexa_user_group.this.id
  email      = "[email protected]" # replace with valid email
  first_name = "BBBBBBBBBBBBBB"
  last_name  = "CCCCCCCCCCCCC"
  role       = "ADMIN"
}

@sahaqaa sahaqaa marked this pull request as ready for review August 2, 2024 13:15
@sahaqaa sahaqaa requested a review from a team as a code owner August 2, 2024 13:15
@sahaqaa
Copy link
Contributor Author

sahaqaa commented Aug 2, 2024

Also fixed issue when changing role, for example, from MEMBER to ADMIN Terraform would apply it and return no error, but in Web UI the role was not changed

@sahaqaa sahaqaa merged commit d3c6d61 into main Aug 5, 2024
3 checks passed
@sahaqaa sahaqaa deleted the improve_cloudconnexa_user-resource branch August 5, 2024 09:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants